//package com.ycy;
//
//import ch.qos.logback.core.PropertyDefinerBase;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.net.InetAddress;
//import java.net.UnknownHostException;
//
//public class IPLogDefiner extends PropertyDefinerBase {
//
//  private final Logger logger = LoggerFactory.getLogger(IPLogDefiner.class);
//
//  @Override
//  public String getPropertyValue() {
//    InetAddress ip = null;
//    try {
//      ip = InetAddress.getLocalHost();
//    } catch (UnknownHostException e) {
//      logger.warn("IPLogDefiner getLocalHost fail:{}", e.getMessage(), e);
//    }
//    if (ip != null) {
//      return ip.getHostAddress();
//    }
//    return "unknown";
//  }
//}
